perm filename CHANGE.TEX[CLS,LSP] blob
sn#847189 filedate 1987-10-19 generic text, type C, neo UTF8
COMMENT ā VALID 00002 PAGES
C REC PAGE DESCRIPTION
C00001 00001
C00002 00002 \beginSection{Changing Classes}
C00007 ENDMK
Cā;
\beginSection{Changing Classes}
The function {\bf change-class} can be used to change the
class of an instance; it will cause the
structure of the instance to be updated to conform to the definition
of the new class.
Note that changing the class of an instance may cause slots to be added or
deleted. When an instance is updated, new slots are initialized and the
values of deleted slots are discarded by {\bf change-class}.
If in the new class there is a local slot of the same
name as any slot in the old class, the value of that
slot is unchanged. This means that if the slot
has a value, the value returned by {\bf slot-value} after {\bf
change-class} is invoked is {\bf eql} to the value returned by {\bf
slot-value} before {\bf change-class} is invoked. Similarly, if the
slot was uninitialized, it remains uninitialized.
Each local slot of the new class with no slot by the same name in the old
class is initialized to the value of the corresponding {\bf :initform}
option of the new class or remains uninitialized if the new class does not
specify or inherit an {\bf :initform} option for that slot.
If in the new class there is a shared slot of the same name as any shared
slot in the old class, the value of that slot will be the same in both.
If in the new class there is a shared slot of the same name as any local
slot in the old class, that shared slot is initialized to the value of the
corresponding {\bf :initform} option of the new class or remains
uninitialized if the new class does not specify or inherit the {\bf
:initform} option for that slot.
After {\bf change-class} has completed the above operations, it invokes
the generic function {\bf class-changed} on two arguments computed by
{\bf change-class}. The first argument passed is a copy of the instance
being updated and is an instance of the old class.
The second argument is the instance as updated
so far by {\bf change-class} and is an instance of the new class $C$.
\endSection%{Changing Classes}